package com.gongpingjialoan.view;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;

import com.gongpingjialoan.R;
import com.gongpingjialoan.utility.DhUtil;

/**
 * Created by Administrator on 2015/11/26.
 */
public class SellCarHelpDialog extends Dialog implements View.OnClickListener {

    private ImageView cancalImageView;

    private int padding;

    public SellCarHelpDialog(Context context) {
        super(context, R.style.dialogs);
        padding = DhUtil.dip2px(context, 20);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.sell_car_help_dialog);
        Window win = getWindow();
        win.getDecorView().setPadding(padding, 0, padding, 0);
        WindowManager.LayoutParams lp = win.getAttributes();
        lp.width = WindowManager.LayoutParams.MATCH_PARENT;
        lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
        win.setAttributes(lp);

        cancalImageView = (ImageView) findViewById(R.id.cancle);
        cancalImageView.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        if(v == cancalImageView){
            dismiss();
        }
    }
}
